Lowrance USR: strip bogus 0x1 characters for accented placemark names.
authorrobertl <robertl>
Fri, 20 Nov 2009 15:02:10 +0000 (15:02 +0000)
committerrobertl <robertl>
Fri, 20 Nov 2009 15:02:10 +0000 (15:02 +0000)
lowranceusr.c

index aa86be9e057d8526850ea46f9e57a0fd615bd77b..9fc1a876616a14dd1c7e6c4ed4b8735ffd5b1513 100644 (file)
@@ -231,9 +231,17 @@ lowranceusr_readstr(char *buf, const int maxlen, gbfile *file)
        org = len = gbfgetint32(file);
        if (len < 0) fatal(MYNAME ": Invalid item length (%d)!\n", len);
        else if (len) {
+               int i;
                if (len > maxlen) len = maxlen;
                (void) gbfread(buf, 1, len, file);
                if (org > maxlen) (void) gbfseek(file, org - maxlen, SEEK_CUR);
+               // IWay 350C puts 0x01 for the accented o in the street name
+               // of the Montreal Holiday Inn.
+                for (i = 0; i < len; i++) {
+                       if (buf[i] == 0x01)
+                               buf[i] = '*';
+               }
+
        }
 
        return len;